﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="ListPage.aspx.cs" Inherits="MO.BusinessServer.Web.ListPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
    <script>var listCode = "<%= this.ListCode %>";</script>
    <div id="div_main">
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderFooter" runat="server">
    <div data-role="navbar" data-iconpos="left">
        <ul>
            <li><a href="/" data-icon="back">返回</a></li>
            <li><a href="#" onclick="location.reload()" data-icon="refresh" class="ui-btn-active">刷新</a></li>
        </ul>
    </div>
    <script>
        $(function () {
            var manager = Proxy.GetInstance("MO.BusinessServer.ListManager");
            var listData = manager.Invoke("GetListData", [listCode]);
            $("#title_h1").text(listData.Name);
            $("title").text(listData.Name);
            var view = $(listData.ViewTemplate);
            var listContent = view.find("#list_content");
            var temp = listContent.html();
            listContent.empty();
            for (var i = 0; i < listData.Datas.length; i++) {
                listContent.append($(nano(temp, listData.Datas[i])));
            }
            $("#div_main").append(view);
            view.trigger('create');
        });
    </script>
</asp:Content>
